package ro.romanescu.useradmin.hibernate;

import java.io.Serializable;

import ro.romanescu.useradmin.IRole;

public class RoleRight implements Serializable {
  private IRole role;
  private String right;

  public void setRole( IRole param ) {
    this.role = param;
  }

  public IRole getRole() {
    return role;
  }

  public void setRight( String param ) {
    this.right = param;
  }

  public String getRight() {
    return right;
  }


  @Override
  public boolean equals( Object object ) {
    if( this == object ) {
      return true;
    }
    if( !( object instanceof RoleRight ) ) {
      return false;
    }
    final RoleRight other = ( RoleRight )object;
    if( !(role == null ? other.role == null : role.equals(other.role)) ) {
      return false;
    }
    if( !(right == null ? other.right == null : right.equals(other.right)) ) {
      return false;
    }
    return true;
  }

  @Override
  public int hashCode() {
    final int PRIME = 37;
    int result = 1;
    result = PRIME * result + ((role == null) ? 0 : role.hashCode());
    result = PRIME * result + ((right == null) ? 0 : right.hashCode());
    return result;
  }
}
